from django.db import models

# Create your models here.
# Create your models
class WebConfig(models.Model):
    id = models.AutoField(primary_key=True)
    param_type = models.CharField(max_length=20, null=True, blank=True)
    param_key = models.CharField(max_length=40, null=False, blank=True)
    param_value = models.CharField(max_length=400, null=True, blank=True)
    description = models.CharField(max_length=400, null=True, blank=True)

    def __str__(self):
        return "Config Key:{}".format(self.param_key)


class SqlConfig(models.Model):
    id = models.AutoField(primary_key=True)
    param_type = models.CharField(max_length=20, null=True, blank=True)
    param_key = models.CharField(max_length=40, null=True, blank=True)
    param_value = models.CharField(max_length=800, null=True, blank=True)
    description = models.CharField(max_length=400, null=True, blank=True)

    def __str__(self):
        return "Config Key:{}".format(self.param_key)

class OracleLink(models.Model):
    id = models.AutoField(primary_key=True)
    tns_name = models.CharField(max_length=40, null=True, blank=True)
    username = models.CharField(max_length=20, null=True, blank=True)
    password = models.CharField(max_length=20, null=True, blank=True)
    description = models.CharField(max_length=40, null=True, blank=True)

    def __str__(self):
        return f"tns_name: {self.tns_name},username: {self.username}"
